package model;

import java.io.Serializable;
import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.GeneratedValue;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

@Entity
@Table(name="BASE", schema = "simos")
public class Base implements Serializable {

	private static final long serialVersionUID = -8761191849785945302L;
	@TableGenerator(
			name="generatorBase",
			pkColumnValue="SEQ_BASE",
			allocationSize=1)
	@Id
	@Column(name="BASE_ID")
	@GeneratedValue(strategy=GenerationType.TABLE, generator = "generatorBase")
	private Integer id;

	@Embedded
	private EstoqueBase estoqueBase;

	@OneToMany(mappedBy = "base")
	private Collection<Peca> colPeca;

	@OneToMany(mappedBy = "base")
	private Collection<Equipamento> colEquipamento;

	public EstoqueBase getEstoqueBase() {
		return estoqueBase;
	}

	public Integer getId() {
		return id;
	}

	public void setEstoqueBase(EstoqueBase estoqueBase) {
		this.estoqueBase = estoqueBase;
	}

	public void setColPeca(Collection<Peca> colPeca) {
		this.colPeca = colPeca;
	}

	public Collection<Peca> getColPeca() {
		return colPeca;
	}

	public void setColEquipamento(Collection<Equipamento> colEquipamento) {
		this.colEquipamento = colEquipamento;
	}

	public Collection<Equipamento> getColEquipamento() {
		return colEquipamento;
	}

}
